package cn.lg.soar.boot.fc.entity;

import cn.lg.soar.core.annotations.constraints.group.*;
import cn.lg.soar.database.query.annotations.*;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.*;
import io.swagger.annotations.*;
import lombok.Data;
import java.io.Serializable;
import java.time.*;
import javax.validation.constraints.*;

import cn.lg.soar.database.base.entity.BaseEntity;

/**
 * 合同表
 * @author ZhuanZ（无密码）
 * @since 2025-02-18
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@ApiModel(value = "Contract", description = "合同表")
@TableName("fc_contract")
public class Contract extends BaseEntity {

    /** 主键id */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 模板id */
    @NotNull(message = "模板id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "模板id")
    @ApiModelProperty(value = "模板id")
    private Long templateId;

    /** 租房ID */
    @NotNull(message = "租房ID不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "租房ID")
    @ApiModelProperty(value = "租房ID")
    private Long tenancyId;

    /** 合同编码 */
    @NotBlank(message = "合同编码不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "合同编码")
    @ApiModelProperty(value = "合同编码")
    private String code;

    /** 合同名 */
    @ExcelProperty(value = "合同名")
    @ApiModelProperty(value = "合同名")
    private String name;

    /** 合同待签路径 */
    @ExcelProperty(value = "合同待签路径")
    @ApiModelProperty(value = "合同待签路径")
    private String voucherUrl;

    /** 签署后路径 */
    @ExcelProperty(value = "签署后路径")
    @ApiModelProperty(value = "签署后路径")
    private String signUrl;

    /** 签订时间 */
    @ExcelProperty(value = "签订时间")
    @ApiModelProperty(value = "签订时间")
    private LocalDateTime signTime;

    /** 状态(0-待签 1-待审核 2-通过 9-拒绝) */
    @NotNull(message = "状态(0-待签 1-待审核 2-通过 9-拒绝)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "状态(0-待签 1-待审核 2-通过 9-拒绝)")
    @ApiModelProperty(value = "状态(0-待签 1-待审核 2-通过 9-拒绝)")
    private Integer state;

    /** 乐观锁 */
    @NotNull(message = "乐观锁不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "乐观锁")
    @ApiModelProperty(value = "乐观锁")
    private Integer version;

    /** 节点id */
    @ExcelProperty(value = "节点id")
    @ApiModelProperty(value = "节点id")
    private String parentId;

    @JsonIgnore
    @Override
    public Long primaryKey() {
        return this.id;
    }

}
